﻿@using MvcForum.Web.Application.ExtensionMethods
@model MvcForum.Core.Models.Entities.PrivateMessage
@{
    var userId = Html.CurrentMember().Id;
}
<div class="pmblock @(Model.UserFrom.Id == userId ? "pmblockto" : "pmblockfrom")">
    <div class="pmmessage">
        @Html.Raw(AppHelpers.ConvertPostContent(Model.Message))
    </div>
    <ul class="pmmessagetools">
        <li>
            <a class="privatemessagedelete" data-id="@Model.Id">
                @Html.Lang("PM.Delete")
            </a>
        </li>
        @if (Model.IsRead && Model.UserFrom.Id == userId)
        {
            <li><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> 
            <span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span></li>
        }
        <li>@DatesUi.GetPrettyDate(Model.DateSent.ToString())</li>
        <li>
            <img src="@Model.UserFrom.MemberImage(14)" alt="@Model.UserFrom.UserName" class="pmsmallavatar" />
        </li>
    </ul>

</div>

